Ext.ns('journal.home');

// {{{
journal.home.NodePropertyDialog = Ext.extend(Ext.Window, (function() {
    return {

        // configurables
        // anything what is here can be configured from outside
        name : 'noname',
        node : null,
        constructor : function(config) {
            config = config || {};
            config.listeners = config.listeners || {};
            journal.home.NodePropertyDialog.superclass.constructor.call(this, config);
        },

        // {{{
        initComponent : function() {

            // hard coded config - cannot be changed from outside
            var config = {
                id : 'node-property-dialog',
                title : this.node.text + ' Properties',
                modal : true,
                resizable : false,
                constrain : true,
                maximizable : false,
                closable : true,
                items : [ new Ext.TabPanel({
                    activeTab : 0,
                    items : [ {
                        title : 'General'
                    } ]
                }) ]
            };// var config

            this.on('render', function() {
                Ext.EventManager.on(this.el, 'keypress', function(e) {
                    if (e.getKey() == e.ENTER) {
                        this.close();
                    }
                }.createDelegate(this));

                //Note: Form has to render first so container will adjust when it resizes on EL change.
                this.add(new journal.home.PropertyDialogForm({
                    node : this.node
                }));

            }.createDelegate(this));
            // apply config
            Ext.apply(this, Ext.apply(this.initialConfig, config));

            // call parent
            journal.home.NodePropertyDialog.superclass.initComponent.apply(this, arguments);

        } // e/o function initComponent
    // }}}
    };
})()); // e/o extend

// register xtype
Ext.reg('journal.home.NodePropertyDialog', journal.home.NodePropertyDialog);
// }}}
